package com.shop.cereshop.app.param.wallet;

import lombok.Data;

/**
 * 钱包支付执行结果
 */
@Data
public class WalletPayExecuteResult {
    
    /**
     * 是否成功
     */
    private boolean success;
    
    /**
     * 结果消息
     */
    private String message;
    
    /**
     * 错误码
     */
    private String errorCode;
    
    /**
     * 交易ID
     */
    private String transactionId;
    
    /**
     * 订单编号
     */
    private String orderFormId;
    
    /**
     * 创建成功结果
     */
    public static WalletPayExecuteResult success(String message, String transactionId, String orderFormId) {
        WalletPayExecuteResult result = new WalletPayExecuteResult();
        result.setSuccess(true);
        result.setMessage(message);
        result.setTransactionId(transactionId);
        result.setOrderFormId(orderFormId);
        return result;
    }
    
    /**
     * 创建失败结果
     */
    public static WalletPayExecuteResult failure(String message, String errorCode) {
        WalletPayExecuteResult result = new WalletPayExecuteResult();
        result.setSuccess(false);
        result.setMessage(message);
        result.setErrorCode(errorCode);
        return result;
    }
}
